<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no" />
		<title>找回密码</title>
		<link rel="stylesheet" type="text/css" href="../css/aui.css" />
		<style>
			body {
				background-color: #F3F3F3;
			}
			.aui-content {
				padding-top: 10%;
			}
			.aui-btn-info{
				background-color: #327AFA;
			}
			.aui-btn-block {
				margin-top: 5px;
				padding: 8px 0;
				font-size: 18px;
				margin: auto;
				width: 100%;
			}
			.aui-input-row {
				margin: 0 18px;
			}
			.aui-input-row {
				border-top: 0px solid #c8c7cc;
				margin-left: 10px;
			}
			.aui-input-row:first-child:after {
				border-top: 0px solid #c8c7cc;
			}
			.aui-btn-row:after {
				border-bottom: 0px solid #c8c7cc;
			}
			.aui-form{
				width: 90%;
				margin:auto;
				margin-top: 15px;
			}
			.aui-input-addon{
				border-right: 1px solid #c8c7cc;
				padding-right: 10px !important;
			}

		</style>
	</head>
	<body>
		<div class="aui-content">
			<div class="aui-form aui-card">
				<div class="aui-input-row">
					<span class="aui-input-addon">新密码</span>
					<input type="tel" id="pwd" class="aui-input" placeholder="输入6-20位数字或字母"/>
				</div>
			</div>
			<div class="aui-form aui-card">
				<div class="aui-input-row">
					<span class="aui-input-addon">再确认</span>
					<input type="tel" id="pwd2" class="aui-input" placeholder="请再输入一次新密码"/>
				</div>
			</div>
			<div class="aui-btn-row">
					<div class="aui-btn aui-btn-info aui-btn-block" tapmode onclick="confirm();">
						提交
					</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../script/api.js"></script>
	<script type="text/javascript" src="../script/common.js"></script>
	<script type="text/javascript">
		var isinerval, times;
		apiready = function() {
			mobile = api.pageParam.mobile;	
			api.parseTapmode();
		}

		//登录
		function confirm() {
			//对比两个密码是否一致
			var pwd = $api.val($api.byId('pwd'));
			var pwd2 = $api.val($api.byId('pwd2'));

			if(pwd !== pwd2){
				api.toast({
                    msg : '密码不一致',
                    duration : 2000,
                    location : 'bottom'
                });
			}else{
				var data = {};
				data['mobile'] = mobile;
				data['password'] = pwd;
				url = 'memberupdate';
				ajaxRequest(url, 'post', data, function(ret, err) {
				if (ret.status == '1') {
						api.toast({
		                    msg : '更新成功',
		                    duration : 2000,
		                    location : 'bottom'
	               	 	});
	               	 	api.openWin({
							name : 'footer_tab_5',
							url : 'footer_tab_5.html',
							delay : 300
						})
				} else {
						api.toast({
		                    msg : '更新失败',
		                    duration : 2000,
		                    location : 'bottom'
		                });
					}
				});
			}
		}


	</script>
</html>